const MAX_OPTIONS :u32 = 100_000;

fn main() {
    println!("Hello, world!");

    println!("const MAX_OPTIONS: {}",MAX_OPTIONS);

    let x = 5;
    let mut y = 5;
    println!("The value of x is {}", x);
    println!("The value of xy is {}", y);
    // cannot assign twice to immutable variable `x`
    // x = 6;
    y = 6;
    println!("The value of xy is {}", y);

    // shadowing
    let x = x + 1;
    let x = x * 2;
    println!("The value of shadowing x is {}", x);

    let spaces = "    ";
    let spaces = spaces.len();

    println!("The value of shadowing spaces is {}", spaces);


    let guess: u32 = "42".parse().expect("Not a number");

    println!("guess: {}", guess);

    // 整数类型 u无符号 i有符号
    //         u8      i8
    // isize  usize  根据计算机架构决定，64位就是 i64 u64， 32位就是 i32 u32


    let x = 2.0;
    println!("x: {}", x);
    let y: f32 = 2.0;
    println!("y: {}", y);
    let t = true;
    println!("t: {}", t);
    let c: bool = false;
    println!("c: {}", c);

    let x = 'z';
    let y: char = ' ';
    let z = '👿';
    println!("x: {}", x);
    println!("y: {}", y);
    println!("z: {}", z);

    let tup = (500,6.4,1);
    println!("{} {} {}", tup.0,tup.1,tup.2);
    let (x,y,z) = tup;
    println!("x: {}", x);
    println!("y: {}", y);
    println!("z: {}", z);

    let a = [0,1,2,3,4];
    println!("{}", a[1]);

}
